import request from '@/utils/request'

export default {

  // 查询讲师列表（current：当前页、limit：每页记录数、teacherQuery：条件对象）
  getTeacherListPage(current, limit, teacherQuery) {

      return request({
        url: `/eduservice/edu-teacher/pageTeacherCondition/${current}/${limit}`,
        method: 'POST',
        data: teacherQuery
      })

  },
  // 根据 id 删除讲师
  deleteById(id) {
    return request({
      url: '/eduservice/edu-teacher/' + id,
      method: 'delete'
    })
  },
  // 添加讲师
  addTeacher(teacher) {
    return request({
      url: `/eduservice/edu-teacher/addTeacher`,
      method: 'POST',
      data: teacher
    })
  },
  // 根据 id 查询讲师
  getTeacherInfo(id) {
    return request({
      url: `/eduservice/edu-teacher/getTeacher/${id}`,
      method: 'GET'
    })
  },
  // 根据 id 修改讲师
  upDataTeacherById(teacher) {
    return request({
      url: `/eduservice/edu-teacher/updateTeacher`,
      method: 'PUT',
      data: teacher
    })
  },

  // 查询所有讲师
  getAllTeacher(){
    return request({
      url: '/eduservice/edu-teacher/findAll',
      method: "get"
      })
  }
}
